package com.pengtu.gsj.dao.lwfw;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.pengtu.gsj.dao.hibernate.HibernateDao;
import com.pengtu.gsj.entity.lwfw.EmergRepair;

/**
 * 
 * EmergRepairCheckDao
 * 
 * 2017年9月1日 上午1:22:17
 * 
 * @version 1.0.0
 * 
 */
@Repository
public class EmergRepairCheckDao extends HibernateDao<EmergRepair, String>{

	public List<EmergRepair> calScoreByEmergRepairs(String startTime, String endTime) {
		String hql = "select new com.pengtu.gsj.entity.lwfw.EmergRepair("
				+ " t.year,"
				+ " SUM(t.reportNum),"
				+ " SUM(t.restoreNum),"
				+ " Round(SUM(t.restoreNum) * 100 / SUM(t.reportNum), 2))"
				+ " from EmergRepair t"
				+ " where t.year >= ? and t.year <= ? and t.delFlag='0'"
				+ " group by t.year"
				+ " order by t.year ASC";
		return find(hql, startTime, endTime);
	}
}
